using MinimalistFoodStreet.BackEnd.Infrastructure.EFCore;
using MinimalistFoodStreet.BackEnd.Infrastructure.Dtos.Response.Tables;
using MinimalistFoodStreet.BackEnd.Infrastructure.Tools;

namespace MinimalistFoodStreet.BackEnd.Server.Server.ResponseExtend.Tables 
{
	public static class AdministratorsEnitityExtend 
	{
		public static ResponseAdministratorsDto ToResponseDto(this Administrator entity,Account account)
		{
			return new ResponseAdministratorsDto()
			{

				id = entity.AId,
				accountId = entity.AAccountId,
				name = entity.AName,
				age = entity.AAge,
				createTime = entity.ACreateTime,
				createTimeStr = Tools.TimeToString(entity.ACreateTime),
				updateTime = entity.AUpdateTime,
				updateTimeStr = Tools.TimeToString(entity.AUpdateTime),
				account = account.AAccount,
				avatar=account.AAvatar,
				isActive=account.AIsActive,
				email=account.AEmail,
				endpoint=account.AEndpoint,
				isBan=account.AIsBan,
				phone=account.APhone
			};
		}
	}
}